package com.xyzh05.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

import org.compass.annotations.Searchable;
import org.compass.annotations.SearchableId;
import org.compass.annotations.SearchableProperty;

@Entity
@Table(name="site_content")
@Searchable
@XmlRootElement
public class SiteContent extends BaseObject implements Serializable {
    private Long id;
    private String appInfo;
    private String about;
    private String support;
    private String contact;
    private String state;
    private String help;
    private Date updateTime;
    private Long updateUser;

    @Id @GeneratedValue(strategy=GenerationType.AUTO) @SearchableId    
    public Long getId() {
        return this.id;
    }
    
    public void setId(Long id) {
        this.id = id;
    }
    
    @Column(name="app_info", length=65535)
    @SearchableProperty
    public String getAppInfo() {
        return this.appInfo;
    }
    
    public void setAppInfo(String appInfo) {
        this.appInfo = appInfo;
    }
    
    @Column(name="about", length=65535)
    @SearchableProperty
    public String getAbout() {
        return this.about;
    }
    
    public void setAbout(String about) {
        this.about = about;
    }
    
    @Column(name="support", length=65535)
    @SearchableProperty
    public String getSupport() {
        return this.support;
    }
    
    public void setSupport(String support) {
        this.support = support;
    }
    
    @Column(name="contact", length=65535)
    @SearchableProperty
    public String getContact() {
        return this.contact;
    }
    
    public void setContact(String contact) {
        this.contact = contact;
    }
    
    @Column(name="state", length=65535)
    @SearchableProperty
    public String getState() {
        return this.state;
    }
    
    public void setState(String state) {
        this.state = state;
    }
    
    @Column(name="help", length=65535)
    @SearchableProperty
    public String getHelp() {
        return this.help;
    }
    
    public void setHelp(String help) {
        this.help = help;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="update_time", nullable=false, length=19)
    @SearchableProperty
    public Date getUpdateTime() {
        return this.updateTime;
    }
    
    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }
    
    @Column(name="update_user", nullable=false)
    @SearchableProperty
    public Long getUpdateUser() {
        return this.updateUser;
    }
    
    public void setUpdateUser(Long updateUser) {
        this.updateUser = updateUser;
    }

    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SiteContent pojo = (SiteContent) o;

        if (appInfo != null ? !appInfo.equals(pojo.appInfo) : pojo.appInfo != null) return false;
        if (about != null ? !about.equals(pojo.about) : pojo.about != null) return false;
        if (support != null ? !support.equals(pojo.support) : pojo.support != null) return false;
        if (contact != null ? !contact.equals(pojo.contact) : pojo.contact != null) return false;
        if (state != null ? !state.equals(pojo.state) : pojo.state != null) return false;
        if (help != null ? !help.equals(pojo.help) : pojo.help != null) return false;
        if (updateTime != null ? !updateTime.equals(pojo.updateTime) : pojo.updateTime != null) return false;
        if (updateUser != null ? !updateUser.equals(pojo.updateUser) : pojo.updateUser != null) return false;

        return true;
    }

    public int hashCode() {
        int result = 0;
        result = (appInfo != null ? appInfo.hashCode() : 0);
        result = 31 * result + (about != null ? about.hashCode() : 0);
        result = 31 * result + (support != null ? support.hashCode() : 0);
        result = 31 * result + (contact != null ? contact.hashCode() : 0);
        result = 31 * result + (state != null ? state.hashCode() : 0);
        result = 31 * result + (help != null ? help.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        result = 31 * result + (updateUser != null ? updateUser.hashCode() : 0);

        return result;
    }

    public String toString() {
        StringBuffer sb = new StringBuffer(getClass().getSimpleName());

        sb.append(" [");
        sb.append("id").append("='").append(getId()).append("', ");
        sb.append("appInfo").append("='").append(getAppInfo()).append("', ");
        sb.append("about").append("='").append(getAbout()).append("', ");
        sb.append("support").append("='").append(getSupport()).append("', ");
        sb.append("contact").append("='").append(getContact()).append("', ");
        sb.append("state").append("='").append(getState()).append("', ");
        sb.append("help").append("='").append(getHelp()).append("', ");
        sb.append("updateTime").append("='").append(getUpdateTime()).append("', ");
        sb.append("updateUser").append("='").append(getUpdateUser()).append("'");
        sb.append("]");
      
        return sb.toString();
    }

}
